package com.treasure.mall.zbqmallapi.vo.integral;

import com.treasure.mall.biz.entity.integral.IntegralProductPO;
import com.treasure.mall.biz.vo.BaseVO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/8/25
 */
@Data
@NoArgsConstructor
public class ProductVO implements BaseVO {
    private static final long serialVersionUID = 1765897821603616952L;

    private Long id;
    private String title;
    private String subTitle;
    /**
     * 尺寸
     */
    private String propSize;
    /**
     * 材质
     */
    private String propMaterial;

    /**
     * 产地
     */
    private String location;

    /**
     * 重量单位
     */
    private String weightUnit;

    /**
     * weight
     */
    private BigDecimal weight;

    /**
     * 市场价格
     */
    private BigDecimal price;
    /**
     * 所需积分
     */
    private long integral;
    /**
     * 库存
     */
    private int store;
    /**
     * 限兑数量
     */
    private int limitExchange;
    /**
     * 缩略图
     */
    private String thumbnail;
    /**
     * 商品图片，英文逗号分割
     */
    private String images;
    /**
     * 商品描述
     */
    private String desc;
    /**
     * 已兑数量
     */
    private long exchangeCount;

    public ProductVO(IntegralProductPO po) {
        this.id = po.getId();
        this.title = po.getTitle();
        this.subTitle = po.getSubTitle();
        this.propSize = po.getPropSize();
        this.propMaterial = po.getPropMaterial();
        this.location = po.getLocation();
        this.weightUnit = po.getWeightUnit();
        this.weight = po.getWeight();
        this.price = po.getPrice();
        this.integral = po.getIntegral();
        this.store = po.getStore();
        this.limitExchange = po.getLimitExchange();
        this.thumbnail = po.getThumbnail();
        this.images = po.getImages();
        this.desc = po.getDesc();
        this.exchangeCount = po.getExchangeCount();
    }
}
